package user.ucm;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import user.view.MainView;

public class UCGST {
    private String gst;
    private String s;

    public UCGST(String s){
        this.s = s;
    }

    public void run(){
        try {
            Class.forName("com.mysql.jdbc.Driver");

            Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/cp3120?user=root&password=root");
            con.setCatalog("cp3120");

            Statement statement = con.createStatement();

            String sql = "update airport set gst = '" + s + "';";
            System.out.println(sql);
            statement.execute(sql);
            
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
